<script setup>
import themeOverrides from "@/plugins/naive-theme/index";
import setVarStyle from "@/plugins/element-theme/index";
import axios from 'axios'

const userStore = useAppStore()
const { naiveLocale } = useAutoLang()


userStore.getAppInfo()
userStore.setAppType()

axios.get(`${import.meta.env.VITE_APP_BASELOCALITY_API}/api/tInfo/selbyid`).then(res => {
  userStore.appInfo = res.data.data.result
}).catch(err => {
  axios.get(`${import.meta.env.VITE_APP_BASE_API}/api/tInfo/selbyid`).then(res => {
    userStore.appInfo = res.data.data.result
  }).catch(err => {
    // console.log(err, 'err2')
  })
})









onMounted(() => {
  setVarStyle('--el-tabs-header-height', '48px')

  setVarStyle('--el-color-primary', import.meta.env.VITE_APP_BASE_COLOR)
  setVarStyle('--el-color-primary-light-9', import.meta.env.VITE_APP_BASE_COLOR)
  setVarStyle('--el-color-primary-light-3', import.meta.env.VITE_APP_BASE_COLOR)
  setVarStyle('--el-dropDown-menuItem-hover-fill', '#ffffff')
  setVarStyle('--el-dropDown-menuItem-hover-color', import.meta.env.VITE_APP_BASE_COLOR)
  setVarStyle('--el-text-color-primary', userStore.titleColor)
})
</script>

<template>
  <n-config-provider :theme="userStore.isDark" :locale="naiveLocale.locale" :date-locale="naiveLocale.dateLocale"
    :theme-overrides="themeOverrides">
    <NMessageProvider>
      <router-view />
    </NMessageProvider>
  </n-config-provider>
</template>

<style>
/* html,
body {
  height: 100%;
  background: #000;
  @apply bg-gray-100 flex flex-col min-h-screen;
} */

/* html{
  -webkit-filter:grayscale(100%);
    -moz-filter:grayscale(100%);
    -ms-filter:grayscale(100%);
    -o-filter:grayscale(100%);
    filter:grayscale(100%);
    filter:url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");
    filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)
} */



::-webkit-scrollbar {
  width: 0px;
}

/* ::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: rgba(117, 146, 168, 1);
  height: 107px;
  background-color: #03a4f8;
  -webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.5);
}

::-webkit-scrollbar-track-piece {
  width: 1px;
  background: rgba(30, 52, 68, 1);
} */


canvas {
  position: fixed;
  left: 0;
  top: 0;
}
</style>
